package com.yue.pattern.singleton;

/**
 * 饿汉单例
 */
public class LazyTwo {

    private LazyTwo() {
    }

    private static LazyTwo hungry = null;

    public static synchronized LazyTwo getInstance() {
        return LazyHolder.LAZY_TWO;
    }

    private static class LazyHolder{
        private static final LazyTwo LAZY_TWO = new LazyTwo();
    }
}
